﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileManager.aspx.cs" Inherits="Paltop_v0._1.UI.FileManager" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="../Styles/JQueryUI/ui-lightness/jquery.ui.all.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../Styles/FileManager/fileManager.css"
        media="screen" />
    <link href="../Styles/FileManager/jquery.treeview.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/Desktop/StickyNoteMenu.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/JQueryUI/facebox.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/PretyPhoto/css/prettyPhoto.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/FileManager/FileManagerRootProperties.css" rel="stylesheet"
        type="text/css" />
    <link href="../Styles/FileManager/photoViewer.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/FileManager/FileProperties.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/JPlayer/jplayer.blue.monday.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" media="all" href="../Styles/JQueryUI/jScrollPane.css" />
    <%Response.Write("\n<script type=\"text/javascript\">");

      Response.Write("\nvar curruntFolderId=" + currentFolderId + ";");
      Response.Write("\nvar treeViewVariable='" + TreeViewInfo + "';");
      Response.Write("\nvar backEnable=" + backEnable.ToString().ToLower() + ";");
      Response.Write("\nvar forwardEnable=" + forwardEnable.ToString().ToLower() + ";");
      Response.Write("\n var usedSpace = " + size + ", freeSpace = " + (1024000 - size) + ";");

      Response.Write("\n</script>");
    %>
    <script type="text/javascript" src="../Scripts/JQuery/jquery-1.6.4.min.js"></script>
    <script type="text/javascript" src="../Scripts/JQuery/JQueryUI/jquery.ui.core.js"></script>
    <script type="text/javascript" src="../Scripts/JQuery/JQueryUI/jquery.ui.widget.js"></script>
    <script type="text/javascript" src="../Scripts/JQuery/JQueryUI/jquery.ui.mouse.js"></script>
    <script type="text/javascript" src="../Scripts/JQuery/JQueryUI/jquery.ui.draggable.js"></script>
    <script type="text/javascript" src="../Scripts/JQuery/JQueryUI/jquery.ui.resizable.js"></script>
    <script src="../Scripts/JQuery/jquery.prettyPhoto.js" type="text/javascript"></script>
    <script src="../Scripts/FileManager/Common.js" type="text/javascript"></script>
    <script src="../Scripts/JQuery/facebox.js" type="text/javascript"></script>
    <script src="../Scripts/FileManager/jquery.treeview.js" type="text/javascript"></script>
    <script type="text/javascript" src="../Scripts/FileManager/highcharts.js"></script>
    <script type="text/javascript" src="../Scripts/FileManager/gray.js"></script>
    <script type="text/javascript" src="../Scripts/FileManager/Piechart.js"></script>
    <script src="../Scripts/JQuery/jquery.jplayer.min.js" type="text/javascript"></script>
    <script src="../Scripts/FileManager/photoViewer.js" type="text/javascript"></script>
    <script src="../Scripts/FileManager/Download.js" type="text/javascript"></script>
    
    <script type="text/javascript">

        // var usedSpace = 45, freeSpace = 55;
        if (curruntFolderId == 0)
            createChart(); 
    </script>
    <script type="text/javascript">

        $(document).ready(function () {
            $('a[rel=facebox]').facebox();
            $("a[rel^='prettyPhoto']").prettyPhoto();
            $('.File').bind("contextmenu", FileRighClick);
            $('.Folder').bind("contextmenu", FolderRightClick);
            $('.Main').bind("contextmenu", FolderSRighClick);
            //            $("#uploadFileButton").click(function () {
            //                alert("test");
            //                var href =  $("#uploadFileButton").attr("href") + curruntFolderId;
            //                 $("#uploadFileButton").attr("href", href);
            //            });
            $('#sideBarContent').html(treeView(treeViewVariable));
            $("#sideBarContent").treeview({ animated: "fast", collapsed: true });
            $("#fileAndFolderPropertiesClose").click(function () { $("#fileAndFolderProperties").fadeOut(500) });
            $("#propertiesClose").click(function () { $("#properties").fadeOut(500) });
            $("#closeMoviePlayer").click(function () { $("#moviePlayer").fadeOut(500); $("#jquery_jplayer_1").jPlayer("stop"); });

        });

            
       
        //$('').replaceWith

        //Write by amir pouya
        //Movie Player
        $(document).ready(function () {

        });

    </script>
    <style type="text/css">
        #mask
        {
            position: absolute;
            left: 0;
            top: 0;
            z-index: 9000;
            display: block;
        }
    </style>
</head>
<body>
    <form id="fileMangerForm" runat="server">
    <div id="mask">
    </div>
    <asp:HiddenField ID="HiddenAction" runat="server" />
    <asp:HiddenField ID="HiddenArgument" runat="server" />
    <asp:HiddenField ID="HiddenSort" Value="title" runat="server" />
    <div class="IconBox">
        <a href="#" id="BackBtn">
            <img src="../TemplateImages/FileManager/back.png" onclick="Back()" title="Click to go back" />
        </a><a href="#" id="ForwardBtn">
            <img src="../TemplateImages/FileManager/forward.png" onclick="Forward()" title="Click to go forward" />
        </a><a href="#">
            <img id="refreshButton" src="../TemplateImages/refresh.png" alt="" onclick="refresh()"
                title="Refresh" />
        </a>
        <%Response.Write(addersBar); %>
        <div class="MenubarText" id="upload">
            <a id="uploadFileButton" href="FileUploader.aspx?FILEID=<%Response.Write(currentFolderId); %>&iframe=true&width=500&height=200"
                rel="prettyPhoto[iframes]">
                <img src="../TemplateImages/upload.png" alt="Upload a new File" title="Upload a file" />
            </a>
        </div>
        <div class="MenubarText" id="newFolder">
            <a id="createNewFolder" href="#addNewFolder" rel="facebox">
                <img src="../TemplateImages/newFolder.png" alt="Create New Folder" title="Create new folder" />
            </a>
        </div>
    </div>
    
    <div id="sideBarContainer">
        <div id="sideBarContent" class="SideBar">
        </div>
    </div>

    <div id="mainContainer">
        <div class="Main">
            <ul id="fileAndFolders" class="fileAndFolders">
                <% Response.Write(fileMangerContent);%>
            </ul>
        </div>
    </div>

    <div id="addNewFolder" style="display: none;">
        <span>Name: </span>
        <input type="text" id="newFolderName" />
        <br />
        <center>
            <input type="button" id="newFolderBtn" onclick="CreateNewFolder()" value="New Folder" /></center>
    </div>
    <div class="StickyNoteMenu FileRightClickMenu">
        <ul>
            <li><a href="#" onclick="FileRightClickItem('Open')">Open</a></li>
            <li><a href="#" onclick="FileRightClickItem('Download')">Download</a></li>
            <li><a href="#" onclick="RightClickItem('Copy','FILE')">Copy</a></li>
            <li><a href="#" onclick="RightClickItem('Cut','FILE')">Cut</a></li>
            <li><a href="#" onclick="RightClickItem('Delete','FILE')">Delete</a></li>
            <li><a href="#" onclick="RightClickItem('Zip','FILE')">Zip</a></li>
            <li><a href="#" onclick="RightClickItem('Properties','FILE')">Properties</a></li>
        </ul>
    </div>
    <div class="StickyNoteMenu FolderRightClickMenu">
        <ul>
            <li><a href="#" onclick="FolderRightClickItem('Open')">Open</a></li>
            <li><a href="#" onclick="RightClickItem('Copy','FOLDER')">Copy</a></li>
            <li><a href="#" onclick="RightClickItem('Cut','FOLDER')">Cut</a></li>
            <li><a href="#" onclick="RightClickItem('Delete','FOLDER')">Delete</a></li>
            <li><a href="#" onclick="FolderRightClickItem('Paste')">Paste</a></li>
            <li><a href="#" onclick="RightClickItem('Zip','FOLDER')">Zip</a></li>
            <li><a href="#" onclick="RightClickItem('Properties','FOLDER')">Properties</a></li>
        </ul>
    </div>
    <div class="StickyNoteMenu FolderSRightClickMenu">
        <ul>
            <li><a href="#" onclick="FolderSpaceRight('CreateNewfolder')">Create newfolder</a></li>
            <li><a href="#" onclick="FolderSpaceRight('UploadFile')">Upload file</a></li>
            <li><a href="#" onclick="FolderSpaceRight('Paste')">Paste</a></li>
            <li><a href="#" onclick="FolderSpaceRight('SortBySize')">Sort by size</a></li>
            <li><a href="#" onclick="FolderSpaceRight('SortByName')">Sort by name</a></li>
            <li><a href="#" onclick="FolderSpaceRight('Properties')">Properties</a></li>
        </ul>
    </div>
    <a rel="facebox" id="showRooProp" href="#properties" style="display: none;">properties</a>
    <div id="properties" style="display: none">
        <div id="Total_Form" class="Properties">
            <div class="PCloseButton">
                <span id="propertiesClose"><a href="#">
                    <img src="../TemplateImages/PhotoViwer/button_grey_close.png" width="24px" height="24px" /></a></span>
            </div>
            <div id="PropetyForm">
                <div id="Up_header">
                    <h1>
                        root properties</h1>
                </div>
                <div id="Size_Number">
                    <div id="SizeDiv1">
                        <label id="UsedSpace">
                            UsedSpace
                        </label>
                        <input id="UsedSpaceNum" type="text" disabled="disabled">
                    </div>
                    <div id="SizeDiv2">
                        <label id="FreeSpace">
                            FreeSpace
                        </label>
                        <input id="FreeSpaceNum" type="text" disabled="disabled">
                    </div>
                </div>
                <div id="Size_Chart" style="width: 440px; height: 300px">
                </div>
            </div>
        </div>
    </div>
    <div id="fileAndFolderProperties" style="display: none;">
        <div id="Total_Form2" class="Properties">
            <div class="PCloseButton">
                <span id="fileAndFolderPropertiesClose"><a href="#">
                    <img src="../TemplateImages/PhotoViwer/button_grey_close.png" width="24px" height="24px" /></a></span>
            </div>
            <form id="PropetyFileForm" action="/">
            <div id="Up_header2">
                <img src="../TemplateImages/FolderImage2.png" align="left" width="35" height="35" />
                <h1 id="fileheader">
                    file properties</h1>
            </div>
            <div id="File_Atr">
                <div id="File_Type" class="filePropertiesFeature">
                    <label id="_Type">
                        Type
                    </label>
                    <input id="FType" type="text" value="" disabled="disabled" />
                </div>
                <div id="File_Location" class="filePropertiesFeature">
                    <label id="_Location">
                        Location
                    </label>
                    <textarea rows="5" cols="17" id="FLocation" disabled="disabled"></textarea>
                </div>
                <div id="File_Size" class="filePropertiesFeature">
                    <label id="_Size">
                        Size
                    </label>
                    <input id="FSize" type="text" value="" disabled="disabled" />
                </div>
                <div id="CreationDate" class="filePropertiesFeature">
                    <label id="Label1">
                        Creation Date
                    </label>
                    <input id="CDate" type="text" value="" disabled="disabled">
                </div>
            </div>
            <div id="Folder_Pic" class="picture">
                <img src="../TemplateImages/FolderImage1.png" align="middle" hspace="150" width="150"
                    height="150" />
            </div>
            </form>
        </div>
    </div>
    <a rel="facebox" id="showTextFile" href="#TextFileContent" style="display: none;">text</a>
    <div id="TextFileContent" style="display: none;">
        <div id="insideTextContent" style="width: 500px;">
        </div>
    </div>
    <div>
        <div id="photoViewer">
            <div id="photoTitle">
            </div>
            <div id="photoContainer">
                <div id="photoCloseBar">
                    <span id="closeButton"><a href="#">
                        <img src="../TemplateImages/PhotoViwer/button_grey_close.png" width="24px" height="24px" /></a></span>
                </div>
                <img alt="" id="photoContainerImage" /><img id="photoWait" src="../TemplateImages/PhotoViwer/ajax-loader (3).gif"
                    class="" />
                <div id="navBar">
                    <span id="nextPhoto"><a href="#">
                        <img id="nextButtImage" src="../TemplateImages/PhotoViwer/playback_next.png" height="24"
                            width="24" class="NavButton" /></a></span> <span id="previosPhoto"><a href="#">
                                <img id="backButtImage" src="../TemplateImages/PhotoViwer/playback_prev.png" height="24"
                                    width="24" class="NavButton" />
                            </a></span>
                </div>
            </div>
        </div>
    </div>
    <div id="moviePlayer" style="display: none">
        <div class="PCloseButton" style="margin: -20px; z-index: 100012;">
            <span id="closeMoviePlayer"><a href="#">
                <img src="../TemplateImages/PhotoViwer/button_grey_close.png" width="24px" height="24px" /></a><br />
            </span>
        </div>
        <div id="jp_container_1" class="jp-video ">
            <div class="jp-type-single">
                <div id="jquery_jplayer_1" class="jp-jplayer">
                </div>
                <div class="jp-gui">
                    <div class="jp-video-play">
                        <a href="javascript:;" class="jp-video-play-icon" tabindex="1">play</a>
                    </div>
                    <div class="jp-interface">
                        <div class="jp-progress">
                            <div class="jp-seek-bar">
                                <div class="jp-play-bar">
                                </div>
                            </div>
                        </div>
                        <div class="jp-current-time">
                        </div>
                        <div class="jp-duration">
                        </div>
                        <div class="jp-controls-holder">
                            <ul class="jp-controls">
                                <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
                                <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
                                <li><a href="javascript:;" class="jp-stop" tabindex="1">stop</a></li>
                                <li><a href="javascript:;" class="jp-mute" tabindex="1" title="mute">mute</a></li>
                                <li><a href="javascript:;" class="jp-unmute" tabindex="1" title="unmute">unmute</a></li>
                                <li><a href="javascript:;" class="jp-volume-max" tabindex="1" title="max volume">max
                                    volume</a></li>
                            </ul>
                            <div class="jp-volume-bar">
                                <div class="jp-volume-bar-value">
                                </div>
                            </div>
                            <ul class="jp-toggles">
                                <li><a href="javascript:;" class="jp-full-screen" tabindex="1" title="full screen">full
                                    screen</a></li>
                                <li><a href="javascript:;" class="jp-restore-screen" tabindex="1" title="restore screen">
                                    restore screen</a></li>
                                <li><a href="javascript:;" class="jp-repeat" tabindex="1" title="repeat">repeat</a></li>
                                <li><a href="javascript:;" class="jp-repeat-off" tabindex="1" title="repeat off">repeat
                                    off</a></li>
                            </ul>
                        </div>
                        <div class="jp-title">
                            <ul>
                                <li>Video Playeer</li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="jp-no-solution">
                    <span>Update Required</span> To play the media you will need to either update your
                    browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/"
                        target="_blank">Flash plugin</a>.
                </div>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
